package org.yray.somehttp.se.hsex;


import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Slf4j
public class MainApp {

    public static void main(String[] args) throws Exception {
       List<String> urls=FileUtils.readLines(new File("D:\\git_upload\\gitee\\utools\\somehttp\\hsex\\url.se"),"utf-8");
       Set<String> urlSets=urls.stream().collect(Collectors.toSet());

       List<String> m3u8s=FileUtils.readLines(new File("D:\\git_upload\\gitee\\utools\\somehttp\\hsex\\m3u8.se"),"utf-8");
       Set<String> m3u8Set= m3u8s.stream().map(v->v.split(",")[0]).collect(Collectors.toSet());
       log.info("{}",urlSets);
       log.info("{}",m3u8Set);
       for(int i=0;i<urls.size();i++)
       {
           String url=urls.get(i);
           if(!m3u8Set.contains(url))
           {
               log.info("do,{}",url);
               DoUrl.doUrl(url);
           }
       }
    }



}
